﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 卷书.SQL
{
    public static class SqliteHelper
    {
        public static string SqlitePath = "";

        public static void ExecuteSql(string sqltext)
        {
            using (SqliteStream sqlite = new SqliteStream(SqlitePath))
            {
                sqlite.RunSql(sqltext);
            }
        }



        public static bool IsProperSqlite( )
        {
            if (!File.Exists(SqlitePath)) return false;
            //是否具有表结构
            bool result = true;
            using (SqliteStream db = new SqliteStream(SqlitePath))
            {
                if (!db.IsTableExist("basic") || !db.IsTableExist("journalarticle") || !db.IsTableExist("degree") )result = false;
            }

            return result;
        }




    }
}
